<?php
    $menuArr = array(
        "TU-001" => array(
            array("fa-home", "Home", "/"),
            array("fa-desktop", "Front Office", "fo-index.php"),
            array("fa-cutlery", "Restaurant", "resto.php"),
            array("fa-tags", "Agent Payment", "agent-payment.php"),
            array("fa-th", "Data Master", "#", array(
                    array("fa-building-o", "Room", "room.php"),
                    array("fa-cutlery", "Menu", "menu.php"),
                    array("fa-tags", "Travel Agent", "agent.php")
                )
            ),
            array("fa-bar-chart-o", "Report", "", array(
                    array("fa-building-o", "Room Lease", "report-room.php"),
                    array("fa-tags", "Agent Report", "report-agent-new.php"),
                    array("fa-cutlery", "Food and Beverage Sale", "report-restaurant.php")
                )
            ),
            array("fa-user", "Management", "#", array(
                    array("fa-user", "User Management", "user.php"),
                    array("fa-users", "User Type", "tipe_user.php"),
                    array("fa-th-list", "Data Seleksi", "data_seleksi.php"),
                )
            ),
            array("fa-wrench", "Setting", "setting.php")
        ),
        "TU-002" => array(
            array("fa-home", "Home", "/"),
            array("fa-desktop", "Front Office", "fo-index.php"),
            array("fa-cutlery", "Restaurant", "resto.php"),
            array("fa-th", "Data Master", "#", array(
                    array("fa-building-o", "Room", "room.php"),
                    array("fa-cutlery", "Menu", "menu.php"),
                    array("fa-tags", "Travel Agent", "agent.php")
                )
            ),
            array("fa-bar-chart-o", "Report", "", array(
                    array("fa-building-o", "Room Lease", "report-room.php"),
                    array("fa-tags", "Agent Report", "report-agent-new.php"),
                    array("fa-cutlery", "Food and Beverage Sale", "report-restaurant.php")
                )
            ),
            array("fa-wrench", "Setting", "setting.php")
        ),
        "TU-003" => array(
            array("fa-home", "Home", "/"),
            array("fa-cutlery", "Restaurant", "resto.php"),
            array("fa-th", "Data Master", "#", array(
                    array("fa-cutlery", "Menu", "menu.php"),
                    array("fa-tags", "Travel Agent", "agent.php")
                )
            ),
        ),
        "TU-004" => array(
            array("fa-home", "Home", "/"),
            array("fa-desktop", "Front Office", "fo-index.php"),
            array("fa-cutlery", "Restaurant", "resto.php"),
            array("fa-tags", "Agent Payment", "agent-payment.php"),
            array("fa-th", "Data Master", "#", array(
                    array("fa-building-o", "Room", "room.php"),
                    array("fa-cutlery", "Menu", "menu.php"),
                    array("fa-tags", "Travel Agent", "agent.php")
                )
            ),
        )
    );
?>
<div id="navigation">
    <ul>
        <?php
            foreach ($menuArr[$global_kode_user] as $value) {
                // echo count($value["3"]);
        ?>
            <li>
                <a href="<?php echo $value["2"]; ?>">
                    <i class="fa <?php echo $value["0"]; ?>"></i>
                    <span> <?php echo $value["1"]; ?> </span>
                    <?php if ((isset($value["3"])) && (count($value["3"]) > 0)) { ?>
                        <i class="fa fa-chevron-right nav-sub"></i>
                    <?php } ?>
                </a>
        <?php if ((isset($value["3"])) && (count($value["3"]) > 0)) { ?>
            <ul>
            <?php foreach ($value["3"] as $valueSub) { ?>
            <li>
                <a href="<?php echo $valueSub["2"] ?>">
                    <i class="fa <?php echo $valueSub["0"]; ?>"></i>
                    <span> <?php echo $valueSub["1"]; ?> </span>
                </a>
            </li>
            <?php } ?>
            </ul>
        <?php } ?>
            </li>
        <?php
            }
        ?>
    </ul>
</div>